import Vue from 'vue'
import Router from 'vue-router'
// import Login from '@/components/login'
// import welcome from '@/components/welcome'
// import NotFound from '@/components/NotFound'
// import systemPub from '@/view/systemPub'
// import imOrder from '@/view/imOrdering'
// import transOrder from '@/view/transportOrder'
// import infoDeta from '@/view/infoDetail'
// import amendPsd from '@/view/amendPassword'


const Login = resolve => require.ensure([], () => resolve(require('@/components/login')), 'Login');
const welcome = resolve => require.ensure([], () => resolve(require('@/components/welcome')), 'welcome');
const NotFound = resolve => require.ensure([], () => resolve(require('@/components/NotFound')), 'NotFound');
const systemPub = resolve => require.ensure([], () => resolve(require('@/view/systemPub')), 'systemPub');
const imOrder = resolve => require.ensure([], () => resolve(require('@/view/imOrdering')), 'imOrder');
const transOrder = resolve => require.ensure([], () => resolve(require('@/view/transportOrder')), 'transOrder');
const infoDeta = resolve => require.ensure([], () => resolve(require('@/view/infoDetail')), 'infoDeta');
const amendPsd = resolve => require.ensure([], () => resolve(require('@/view/amendPassword')), 'amendPsd');

const orderDetail = resolve => require.ensure([], () => resolve(require('@/view/orderDetail')), 'orderDetail');


Vue.use(Router);

const routes = [
  {
    path: '/login',
    component: Login,
    hidden: true
  },
  {
    path: '/',
    component: Login,
    hidden: true
  },
  {
    path: '/404',
    component: NotFound,
    name: '404',
    leaf: true,
    hidden: true
  },
  {
    name: "",
    path: "/",
    component: systemPub,
    iconCls: "",
    hidden: true,
    leaf: true,
    children: [
     
    ]
  },
  {
    name: "",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "首页",
        path: "welcome",
        component: welcome,
        iconCls: "el-icon-star-on",
        leaf: true,
      },

    ]
  },{
    name: "用车管理",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "我要用车",
        path: "imorder",
        component: imOrder,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "用车订单",
        path: "transorder",
        component: transOrder,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "订单详情",
        path: "orderDetail",
        component: orderDetail,
        iconCls: "el-icon-star-on",
        leaf: true,
      },
      
      
    ]
  },{
    name: "个人中心",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "个人信息",
        path: "infoDeta",
        component: infoDeta,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "修改密码",
        path: "amendPsd",
        component: amendPsd,
        iconCls: "el-icon-star-on",
        leaf: true,
      },
      
      
    ]
  },

]

const router = new Router({
  routes
});


export default router
